Circuit arrangement for calculating a check digit

ABSTRACT

A circuit for calculating and employing a check digit, having two module M counters, the first counter coupled directly to a weighted series of pulses, the second counter responsive to a carry from the first counter for counting double the number of input pulses applied to the first counter, completion of the series providing the M complement of the check digit in said second counter, and providing the check digit to the circuit resulting in nonzero condition in the second counter of the digit sequence is in error.

United States Patent lnventor Appl. No. Filed Patented Assignee CIRCUIT ARRANGEMENT FOR CALCULATING A CHECK DIGIT Primary Examiner-Malcolm A. Morrison Assistant ExaminerCharles E. Atkinson Attorney-Frank R. Trifari ABSTRACT: A circuit for calculating and employing a check digit, having two module M counters, the first counter coupled 6Clmms2Drawmg directly to a weighted series of pulses, the second counter US. Cl 235/153, responsive to a carry from the first counter for counting dou- 235/6l.7, 340/146.1 ble the number of input pulses applied to the first counter, Int. Cl ..G06f 11/10, completion of the series providing the M complement of the G08c 25/00 check digit in said second counter, and providing the check Field of Search 235/153, digit to the circuit resulting in nonzero condition in the second 61.7; 340/ 1 46.1 counter of the digit sequence is in error.

3 X I I U a/ I 1 J J PATENTEU Jun 11971 3P" 1-\ I v 1v 0 w 72 y a fig.1

' M+ ZiJmp l i M nu fig.2

INVENTOR.

UWE B ERTRAM CIRCUIT ARRANGEMENT FOR CALCULATING A CHECK DIGIT The invention relates to a circuit arrangement for calculating a check digit for checking data by means of weighted transverse sums in accordance with the relation:

wherein Z, designates the digits, m the number of digits, i the place of the digit in the number, P the check digits, M an integer most differing from the divisor and G, the weights arrayed in dependence upon the places in the descending sequence of natural numbers.

Errors may occur in writing and/or transmitting data. In general it is required to assess these errors in an early stage. In order to assess any errors, digit groups are provided with one or more redundant check digits. A digit group provided with check digits then has the form: Z,, Z Z Z,,,.P,, P,,. In writing or transmitting such guarded digit groups an investigation for errors may be carried out when the check digits are calculated a second time and compared with the added check digits. Wiring or transmission is free of errors when the check digits correspond.

For the calculation of the check digits various methods are known. In most of them the calculation is carried out by weighted transverse sum formation of the digit groups in accordance with the relation:

Therein G, designates the weights, Z, the digits of the digit group, m the number of digits exclusive of the check digit and M an integer having no common factors with the possible values of G, and Z Known circuit arrangements for providing check digits form the products GrZ, via a multiplying matrix. Such apparatus have a comparatively complicated electric structure. Other arrangements calculate the check digits by cyclic methods without multiplying matrix. Then the order of succession and the magnitude of the separate weights are fixed by the method and the circuit arrangement respectively.

There are known checking methods in which constant data such as account numbers are definitely provided with a check digit, the check digit being formed on the aforesaid law, whilst the weights thereof arrayed in the descending sequence of the natural numbers. In these cases the checking system cannot be modified and a most simple embodiment has to be found.

This problem is solved by the circuit arrangement according to the invention, which is characterized in that two mod M counters are provided, both of which count the pulses representing the incoming digit for every M+Z,, whereas at each supplied digit the second counter receives the pulses coming in after the carry signal of the first counter in two-fold.

The checking function is fulfilled in avery simple manner by switching off the direct counting of the M+Z, pulses by the second counter.

The drawing shows one embodiment of the invention. Therein FIG. I is the basic diagram,

FIG. 2 illustrates the pulse diagram for the calculation of a check digit.

Prior to the calculation of the check digit mod M counter l and mod M counter 2 are in the rest position O=M and the switch 7 is closed. For writing the first digit Z M+Z pulses are supplied through the conductor 3, which pulses are counted in the two counters. When the counter 1 reaches after M pulses, the position =M, the AND gate 6 is released through the bistable trigger 5, after energization along line 4 and the further M+Z -M= pulses are counted in addition in the counter 2 through the OR gate 8. The counter I is at the end of the pulse sequence in the position Z 1 and the counter 2 is in the position Z,+Z,. After the termination of the counting operation the bistable trigger is put into the rest position by a resetting pulse via the conductor 9.

2. digit At the supply of the second digit M+Z pulses are applied through the pulse conductor 3 and counted again in both counters. After M-Z pulses the counter position O=M of the counter l is again exceeded, that is to say, the AND gate 6 is released and the further M-+-Z -(M--Z,)=Z pulses are again counted in addition in the counter 2. At the end of the counting operation the position of the counter l is Z +Z and that of the counter 2 is 2.Z,+Z +,+ZA2=3.Z,+2.Z

ln the same manner the counting operation is continued up to the digit Z,,,. The contents of the counter 2 are then the M complement of the check digit.

For checking digit sequences with check digits the check digit is also supplied. In order to reobtain the same weight factors in spite of the additional count of the test digit, the direct supply of the M+Z pulses to the counter 2 is interrupted by a switch 7. At the beginning of the count the counters 1 and 2 are again in the position 0=M. After counting of the pulse sequence M+Z,, only the pulses of the pulse conductor 3 are counted in the counter 2, which pulses are supplied via the AND gate 6 after the counter 1 has reached the position 0=M. It is then M+Z,M= pulses. The counters l and 2 are both in the position Z After M+Z pulses have been written, counting starts in counter 2, when after M-Z, pulses the AND gate 6 is released. The counter 2 thus receives M+Z (MZ,) pulses. The new position of the counter 2 is then Z,+Z +ZA 1=2.Z,+ZA2.

The counting operation is continued in the same manner for all digits inclusive of the check digit so that at the end of the calculation the counter 2 indicates:

If the result of the check is not 0=M, an error is made. With reference to a numerical example the calculation and the check operations will be explained.

.M=11;m=3; Z Z ,Z =492. Calculation of the check digit for the digit sequence 492;

Position of counter 1 Writing Position of counter 2 Test of controllable digit sequence 4928 In the circuit arrangement of FIG. 1 the additional pulses are produced across the AND gate 6 and the OR gate 8 by applying the input pulses in the inverted state to one input of the AND gate 6 so that front and rear flanks of the input pulses form the rhythm of the counter 2. In order to permit these flanks to beseparately operative, pulses have tobe derived therefrom before the OR gate 8 the period of which pulses is short as compared with the duration of the input pulses, for example, by differentiation of the flanks as is indicated in the pulse diagram of FIG. 2.

What I claim is:

I. A circuit arrangement for calculating a check digit from a plurality of digits for data control by means of weighted transverse sums in accordance with the relation:

Wherein Z, designates the digits, m the number of digits, i the place of the digit, P the check digit, Man integer having no common factors with the possible values of G, and Z and G, the weights arithmetically arrayed in dependence upon the place in the descending sequence of the natural numbers, comprising first and second modM counters, first means introducing each of said weighted digits in pulse form in descending sequence to said first counter, second means introducing each of said digits in weighted form, for summation as digits pulses, in descending sequence to said second counter, and third means responsive to a carry signal from said first counter for doubling the input pulses to said second counter, the state of said second counter after introduction of all of said plurality of digits representative of said check digit 2. The combination of claim 1 wherein said circuit arrangement provides an indication of erroneous digit transmission of said plurality of digits with said check digit, said circuit arrangement including a switch in said second means, said switch being in an open position, said first means for introducing each of said digits in weighted form for summation as pulses in descending sequence to said first counter said check digit submitted last, said second counter counting pulses only at said double rate upon activation of said third means, the state of said second counter after introduction of all of said plurality of digits including said check digit indicating a state of() mod M for error free transmission.

3. A circuit arrangement as claimed in claim I wherein said check digit P is the complement ofthe resultant position of the second mod M counters 4. A circuit arrangement as claimed in claim 1 wherein the carry signal of the first counter sets a bistable trigger, the output of said bistable trigger being connected to one input of an AND gate, the other input of said AND gate receiving input pulses from said first means the output of said AND gate being connected through an OR gate to the counting input of said second counter, said second means applying said input pulses through a second input of said OR gate to the counting input of said second counter.

5. A circuit arrangement as claimed in claim 4 wherein said second means includes a switch which is open at the check of a digit sequence already provided with a check digit and in that said second mod M counter delivers an error signal, if it has not reached its O-position after complete writing of a digit sequence provided with said check digit.

6. A method of calculating a check digit from a plurality of digits and using said check digit to check accuracy of transmission of said plurality of digits, each of said digits represented by a plurality of pulses, in descending order of significance, comprising the steps of counting in a module M counter said pulses in accordance with the relationship (m+l ).Z,+M,Z m).Z +..,2.Z,,,=Ma! mod M wherein m is the number of digits in said plurality, Z is the digit in descending order of significance, M is the module of said counter, and P is the check digit, said counter at the completion of said count providing an indication of said check digit P, and counting in said counter a transmitted plurality of said digits including said check digit in accordance with the relationship (m+l ).Z +m.Z +(ml ).Z +...2.Z,,,+I wherein a resultant of other than 0 mod M indicates error in said transmission.

po-loso rs/se) Patent No.

Inventor(s) 3 .582 636 Dated June 1, 1971 We Bertram It is certified that error appears in the above-identified patent and that said Letters Patent are hereby corrected as shown below:

Col. 1,

Col. 11'

Claim 1,

Claim 6,

(STEAL) Attost:

EDWARD M FLE'ICIIERJR. Attosting Officer line 46, after "on" insert the basis of; 1

line 46, "whilst" should be -while;

line 72, "M+Z -M= should be -M+Z M=Z -T line 5, "M+Z -(MZ =Z should be M+Z (MZ line 8, "2.Z +Z +ZA2=3 .Z +2.Z should be --2.Z +Z +Z +Z =3.Z +2.Z

line 12, "MA lP mod M" should be -M P mod M,-

line 22, "M+Z M= should be -M+Z M=Z line 27, "Z +Z +ZAl=2 .Z +ZA2" should be Z +Z2+Z 2 Zl+Z2"-,

line 31, .+2.Z +PAxO mod M" should be .+2.Z +P 0 mod M-,-

IN THE CLAIMS in the formula m should be m i=i i=1 in the first formula:

" (m+l) .Z +M.Z m) .Z 2.Z =M-aP mod M" should be -(m+l) .Z +m.Z +(ml) .Z 2.Z =M P mod M- 'wignod and sealed this 5th day of September 1972.

ROBERT GOTTSCIIALK Commissioner of Patents 

1. A circuit arrangement for calculating a check digit from a plurality of digits for data control by means of weighted transverse sums in accordance with the relation: Wherein Zi designates the digits, m the number of digits, i the place of the digit, P the check digit, Man integer having no common factors with the possible values of Gi and Zi, and Gi the weights arithmetically arrayed in dependence upon the place in the descending sequence of the natural numbers, comprising first and second mod M counters, first means introducing each of said weighted digits in pulse form in descending sequence to said first counter, second means introducing each of said digits in weighted form, for summation as digits pulses, in descending sequence to said second counter, and third means responsive to a carry signal from said first counter for doubling the input pulses to said second counter, the state of said second counter after introduction of all of said plurality of digits representative of said check digit.
 2. The combination of claim 1 wherein said circuit arrangement provides an indication of erroneous digit transmission of said plurality of digits with said check digit, said circuit arrangement including a switch in said second means, said switch being in an open position, said first means for introducing each of said digits in weighted form for summation as pulses in descending sequence to said first counter said check digit submitted last, said second counter counting pulses only at said double rate upon activation of said third means, the state of said second counter after introduction of all of said plurality of digits including said check digit indicating a state of 0 mod M for error free transmission.
 3. A circuit arrangement as claimed in claim 1 wherein said check digit P is the complement of the resultant position of the second mod M counter.
 4. A circuit arrangement as claimed in claim 1 wherein the carry signal of the first counter sets a bistable trigger, the output of said bistable trigger being connected to one input of an AND gate, the other input of said AND gate receiving input pulses from said first means the output of said AND gate being connected through an OR gate to the counting input of said second counter, said second means applying said input pulses through a second input of said OR gate to the counting input of said second counter.
 5. A circuit arrangement as claimed in claim 4 wherein said second means includes a switch which is open at the check of a digit sequence already provided with a check digit and in that said second mod M counter delivers an error signal, if it has not reached its 0-position after complete writing of a digit sequence provided with said check digit.
 6. A method of calculating a check digit from a plurality of digits and using said check digit to check accuracy of transmission of said plurality of digits, each of said digits represented by a plurality of pulses, in descending order of significance, comprising the steps of counting in a module M counter said pulses in accordance with the relationship (m+1).Zi+M.Z2+(m-1).Z3+...2.Zm M-P mod M wherein m is the number of digits in said plurality, Z is the digit in descending order of significance, M is the module of said counter, and P is the check digit, said counter at the completion of said count providing an indication of said check digit P, and counting in said counter a transmitted plurality of said digits including said check digit in accordance with the relationship (m+1).Z1+m.Z2+(m-1).Z3+...2.Zm+P wherein a resultant of other than 0 mod M indicates error in said transmission. 